import { axios } from "../utils/request";

const api = {
  PageList: "/sysModule/page",
  SimplList: "/sysModule/simpleList",
  Save: "/sysModule/save",
  DELETE: "/sysModule/delete"
};

/**
 * 获取模块列表
 * parameter: {
 *     name: '',
 *     menuType: 1
 * }
 * @param parameter
 * @returns {*}
 */
export function PageList(parameter) {
  return axios({
    url: api.PageList,
    method: "get",
    params: parameter
  });
}

/**
 * 新增保存 模块
 * @param {*} data
 */
export function saveSysModule(data) {
  console.log(data);
  return axios({
    url: api.Save,
    method: "post",
    data: data
  });
}

/**
 * 删除模块
 */
export function deleteSysModule(id) {
  console.log(id)
  return axios({
    url: api.DELETE,
    method: "DELETE",
    params: id
  });
}

export function simplList(parameter) {
  return axios({
    url: api.SimplList,
    method: "get",
    params: parameter
  });
}
